using System.ComponentModel;
using System.Runtime.CompilerServices;
using SageKing.Designer.Core.Models;
using SageKing.Designer.Core.Attributes;
using JetBrains.Annotations;

namespace SageKing.Designer.Core.Activities;

/// <summary>
/// Represents an inline code activity that can be used to execute arbitrary .NET code from a workflow.
/// </summary>
[Browsable(false)]
[Activity("SageKing", "Primitives", "Evaluate a Boolean condition to determine which path to execute next.")]
[PublicAPI]
public class Inline : CodeActivity
{ 
    /// <inheritdoc />
    public Inline(Action activity, [CallerFilePath] string? source = default, [CallerLineNumber] int? line = default) : base(source, line)
    {
    }

    public Inline(Func<ValueTask> activity, string? source, int? line)
    {
    }
}

/// <summary>
/// Represents an inline code activity that can be used to execute arbitrary .NET code from a workflow and return a value.
/// </summary>
[PublicAPI]
public class Inline<T> : CodeActivity<T>
{
    public Inline(Func<T> activity, MemoryBlockReference? output, string? source, int? line)
    {
        Activity = activity;
        Output = output;
        Source = source;
        Line = line;
    }

    public Inline(Func<ValueTask<T>> activity, MemoryBlockReference? output, string? source, int? line)
    {
        Output = output;
        Source = source;
        Line = line;
    }

    public Func<T> Activity { get; }
    public MemoryBlockReference? Output { get; }
    public string? Source { get; }
    public int? Line { get; }
}